from PyQt5.QtWidgets import QApplication, QToolBar, QLineEdit, QLabel
from PyQt5.QtCore import Qt
from app_setmenubar import MenuBarWindow
import sys


class ToolBarWindow(MenuBarWindow):
    def __init__(self):
        super(ToolBarWindow, self).__init__()

        self.toolBars = QToolBar('MainTool', self)
        self.toolBars.setFloatable(True)
        self.toolBars.setObjectName('ToolBar')
        self.toolBars.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        self.toolBars.addActions([
            self.actionFileCreateProject, self.actionFileOpenProject, self.actionSaveProject, self.toolBars.addSeparator(),
            self.actionAddPage, self.actionDeletePage, self.actionLastPage, self.actionNextPage, self.toolBars.addSeparator(),
            self.actionNewLabel, self.actionEditLabel, self.actionDeleteLabel, self.toolBars.addSeparator(),
            self.actionRedoPixel, self.actionUndoPixel, self.actionRefreshPixel, self.toolBars.addSeparator(),
            self.actionOut, self.actionOutDelete
        ])
        self.addToolBar(self.toolBars)
        self.addToolBarBreak(Qt.TopToolBarArea)

        self.projectShowLineEdit = QLineEdit(self)
        self.projectShowLineEdit.setFocusPolicy(Qt.NoFocus)
        self.projectLabel = QLabel('项目工程绝对地址：')

        self.toolBars2 = QToolBar('InfoTool', self)
        self.toolBars2.setMovable(False)
        self.toolBars2.setObjectName('ToolBar2')
        self.toolBars2.addWidget(self.projectLabel)
        self.toolBars2.addWidget(self.projectShowLineEdit)
        self.addToolBar(self.toolBars2)
        # ----- 工具栏设置 ----- #





if __name__ == '__main__':
    app = QApplication(sys.argv)
    main_window = ToolBarWindow()
    main_window.windowShow()
    sys.exit(app.exec_())